package com.ywh.hilttest.test6

import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class FragmentObjectActivitySingleton2 : Fragment() {


    //同一Activity单例
    @Inject
    lateinit var singletonActivity: SingletonActivity

    @Inject
    lateinit var singletonActivity2: SingletonActivity


    //同一Activity单例
    @Inject
    lateinit var singletonSdkActivity: SingletonSdkActivity

    @Inject
    lateinit var singletonSdkActivity2: SingletonSdkActivity

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        Log.e("HiltTest", "SingletonActivity-hashCode in ${this::class.java.simpleName}:${singletonActivity.hashCode()},${singletonActivity2.hashCode()}")
        Log.e("HiltTest", "SingletonSdkActivity-hashCode in ${this::class.java.simpleName}:${singletonSdkActivity.hashCode()},${singletonSdkActivity2.hashCode()}")

    }
}